import request from '@/utils/request'
// -------------日历任务------------
const BASE = "/service/actionTask"

// 获取任务列表
export const getServiceActionTaskListApi = (params) => {
    return request({
        url: `${BASE}/list`,
        method: 'get',
        params
    })
}

// 添加一个任务
export const addServiceActionTaskApi = (data) => {
    return request({
        url: `${BASE}/add`,
        method: 'post',
        data
    })
}

// 删除一个任务
export const removeServiceActionTaskApi = (params) => {
    return request({
        url: `${BASE}/remove`,
        method: 'DELETE',
        params
    })
}

// 修改一个任务 /service/actionTask/edit
export const editServiceActionTaskApi = (data) => {
    return request({
        url: `${BASE}/edit`,
        method: 'post',
        data
    })
}

// 用于首页时间修改 /service/actionTask/update
export const editServiceTimeApi = (data) => {
    return request({
        url: `${BASE}/update`,
        method: 'post',
        data
    })
}
// 获取任务的详细信息 /service/actionTask/getInfo
export const getInfoServiceActionTaskApi = (params) => {
    return request({
        url: `${BASE}/getInfo`,
        method: 'get',
        params
    })
}

// 批量修改任务状态 /service/actionTask/updateStatus
export const updateStatusActionTaskApi = (data) => {
    return request({
        url: `${BASE}/updateStatus`,
        method: 'put',
        data
    })
}

// 修复任务状态 /service/actionTask/updateTaskUserStatus/{taskId}/{status}
export const updateTaskUserStatusActionTaskApi = (data) => {
    return request({
        url: `${BASE}/updateTaskUserStatus/${data.taskId}/${data.status}`,
        method: 'put',
    })
}
// 修改当天任务状态 /actionTask/updateTodayStatus
export const updateTodayStatusApi = (data) => {
    return request({
        url: `${BASE}/updateTodayStatus`,
        method: 'put',
        data
    })
}

// 修改任务显示和隐藏 
export const taskDisplayApi = (data) => {
    return request({
        url: `${BASE}/updateDisplay?id=${data.id}&display=${data.display}`,
        method: 'post',
    })
}

